# Composition

This notebook goes over how to compose multiple prompts together. This can be useful when you want to reuse parts of prompts. This can be done with a PipelinePrompt. A PipelinePrompt consists of two main parts:

- Final prompt: This is the final prompt that is returned
- Pipeline prompts: This is a list of tuples, consisting of a string name and a prompt template. Each prompt template will be formatted and then passed to future prompt templates as a variable with the same name.

import CodeBlock from "@theme/CodeBlock";
import Example from "@examples/prompts/pipeline_prompt.ts";

<CodeBlock language="typescript">{Example}</CodeBlock>
